home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 43
/
Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso
/
-serious-
/
archivers
/
xpk
/
xpk_source
/
test
/
testcurrenttime.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-14
|
1KB
|
55 lines
#define NAME "testCurrentTime"
#define DISTRIBUTION "(Freeware) "
#define REVISION "1"
/* Programmheader
Name: testCurrentTime
Author: SDI
Distribution: Freeware
Description: tests CurrentTime function
Compileropts: -gM
Linkeropts: -l amiga
1.1 06.12.96 : added header
*/
#include <proto/intuition.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include "SDI_defines.h"
ULONG DosVersion = 37;
struct Library *IntuitionBase = 0;
void main(void)
{
ULONG sec, usec, sec0, usec0, tim;
if((IntuitionBase = OpenLibrary("intuition.library",33)))
{
CurrentTime(&sec0, &usec0);
Printf("%lu %lu\n",sec0,usec0);
while(!CTRL_C)
{
CurrentTime(&sec, &usec);
if(usec >= usec0)
{
sec = sec - sec0;
usec = usec - usec0;
}
else
{
sec = sec - sec0 - 1;
usec = usec + 1000000 - usec0;
}
tim = (sec<<7) + usec / (1000000>>7);
Printf("%lu %lu %lu\n", sec, usec, tim);
}
CloseLibrary(IntuitionBase);
}
exit(0);
}